﻿<mCls:MetroWindow
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:view="clr-namespace:LegoMachine.View"
	xmlns:mCls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
	xmlns:lmCls="clr-namespace:LegoMachine.UI.Controls"
	xmlns:lmView="clr-namespace:LegoMachine.View"
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
	x:Class="LegoMachine.MainWindow"
	Title=" " Height="768" Width="1368" Background="White"
	IsManipulationEnabled="True">
	
	<Window.Resources>
		<lmView:SelectSampleConfigMenuView x:Key="SscmView" />
		<lmView:TuringMachineView x:Key="TmView" />
		<lmView:SelectModeMenuView x:Key="SmmView" />
		<lmView:SampleConfigForAdditionView x:Key="ScAdditionView" />
		<lmView:SampleConfigForCompressionView x:Key="ScCompressionView" />
		<lmView:SampleConfigForInversionView x:Key="ScInversionView" />
	</Window.Resources>

	<mCls:MetroWindow.WindowCommands>
		<mCls:WindowCommands>
			<CheckBox
				x:Name="EnvironmentChecker"
				Opacity="0.25" Margin="0,0,20,0"
				VerticalAlignment="Center" VerticalContentAlignment="Center"
				Checked="OnEnvironmentCheckerChecked" Unchecked="OnEnvironmentCheckerChecked" />
			<Button Content="меню" Click="MainMenuItemClick" />
			<Button Click="SettingsMenuItemClick">
				<StackPanel Orientation="Horizontal">
					<Rectangle Width="14" Height="14" Margin="0,0,0,-2">
						<Rectangle.Resources>
							<SolidColorBrush x:Key="BlackBrush" Color="White" />
						</Rectangle.Resources>
						<Rectangle.Fill>
							<VisualBrush Stretch="Fill" Visual="{StaticResource appbar_settings}" />
						</Rectangle.Fill>
					</Rectangle>
					<TextBlock Text="настройки" VerticalAlignment="Center" Margin="5,0,0,0" />
				</StackPanel>
			</Button>
		</mCls:WindowCommands>
	</mCls:MetroWindow.WindowCommands>
	
	<Grid>

		<MediaElement
			Name="BackVideoMediaElement"
			ClipToBounds="True"
			Grid.RowSpan="2"
			Margin="-60,0,-60,0"
			Source="Assets/Video/BackVideo1.mp4"
			Loaded="OnBackVideoLoaded"
			LoadedBehavior="Manual" Volume="0"
			MediaEnded="OnBackVideoMediaEnded"
			MediaFailed="OnBackVideoMediaFailed"
			Stretch="UniformToFill" IsMuted="True">
		</MediaElement>
		
		<Rectangle
			Fill="White"
			Opacity="0.60">
		</Rectangle>
		
		<lmCls:TransitionContentControl x:Name="MainContentRegion" />

		<lmCls:ChildWindow x:Name="SscWindow" IsOpen="{Binding Path=IsSelectCurrentConfigMode, Mode=OneWay}">
			<lmCls:ChildWindow.HeaderContent>
				<TextBlock Text="Выбор Алгоритма" Style="{DynamicResource TextBlockStyleSubHeader}" />
			</lmCls:ChildWindow.HeaderContent>
			<lmCls:ChildWindow.FooterContent>
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,0">
					<Button
						Width="100" Margin="0"
						Content="Выбрать"
						Command="{Binding Path=SetCurrentConfigCommand, Mode=OneWay}"
						CommandParameter="{Binding Path=Configs.SelectedItem, Mode=OneWay}">
					</Button>
					<Button
						Width="100" Margin="8,0,0,0"
						Content="Отмена"
						Command="{Binding DisableSelectCurrentConfigModeCommand, Mode=OneWay}">
					</Button>
				</StackPanel>
			</lmCls:ChildWindow.FooterContent>
			<lmView:SelectCurrentConfigView x:Name="SccView" />
		</lmCls:ChildWindow>
		
		<lmCls:ChildWindow x:Name="DsWindow" IsOpen="False">
			<lmCls:ChildWindow.HeaderContent>
				<TextBlock Text="Настройки" Style="{DynamicResource TextBlockStyleSubHeader}" />
			</lmCls:ChildWindow.HeaderContent>
			<lmCls:ChildWindow.FooterContent>
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,0">
					<Button
						Width="100" Margin="0"
						Content="Сохранить"
						Command="{Binding Path=DoSaveCommand, Mode=OneWay}">
					</Button>
				</StackPanel>
			</lmCls:ChildWindow.FooterContent>
			<lmView:DeviceSettingsView x:Name="DsView" />
		</lmCls:ChildWindow>
		
	</Grid>
</mCls:MetroWindow>
